
$(document).ready(function(){
	var status=$("#status").val();
	var userId=getvl("userId");
	findIncomeList(status,userId);
});







function findIncomeList(status,userId){
	$("#thislist").html("");
	   $.ajax({
        url: urlcore + "/api/incomeFlow/selectIncomeFlowList?status=" +status+"&muserId="+userId,
        type: "get",
        dataType: 'json',
        contentType: "application/json;charset=utf-8",
        success: function (data) {
        	var da=data.data;
        	var html="",status="",uptDatetime="- -";
        	for(var i=0;i<da.length;i++){
        		if(da[i].status==1){
        			status="已完成";
        		}else if(da[i].status==2){
        			status="等待中";
        		}
        		
        		if(da[i].uptDatetime!=null){
        			uptDatetime=da[i].uptDatetime;
        		}
        	    html+= " <tr >\n" +
			            " <td>" + (i + 1) + "</td>\n" +
			            " <td>" + da[i].order.orderNumber + "</td>\n" +
			            " <td>" + da[i].order.muser.userName + "</td>\n" +
			            " <td>" + da[i].order.totalPrice + "</td>\n" +
			            " <td>" + da[i].income+ "</td>\n" +
			            " <td>" + status+ "</td>\n" +
			            " <td>" + da[i].gmtDatetime+ "</td>\n" +
			            " <td>" + uptDatetime+ "</td>\n" +
			            " </tr>";
        	}
        	$("#thislist").append(html);
        	
        },
        error: function () {
            /* Act on the event */
            alert("error");
        }
    });
	
}


function searchList(){
	
	var status=$("#status").val();
	var userId=getvl("userId");
	findIncomeList(status,userId);
	
}
